package com.pollux.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@AllArgsConstructor
@NoArgsConstructor
/**
*
* @TableName comment
*/
public class Comment implements Serializable {

    /**
    * 主键
    */
    @NotNull(message = "[主键]不能为空")
    @Schema(name = "id", description = "主键", example = "1", type = "object", requiredMode = Schema.RequiredMode.REQUIRED)
    private Object id;

    /**
    * 属于帖子id
    */
    @NotNull(message = "[属于帖子id]不能为空")
    @Schema(name = "postId", description = "属于帖子id", example = "123", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer postId;

    /**
    * 评论时间
    */
    @NotNull(message = "[评论时间]不能为空")
    @Schema(name = "commentTime", description = "评论时间", example = "2023-10-01 12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime commentTime;

    /**
    * 点赞数
    */
    @Schema(name = "goodNumber", description = "点赞数", example = "10", type = "integer")
    private Object goodNumber;

    /**
    * 评论状态
    */
    @NotNull(message = "[评论状态]不能为空")
    @Schema(name = "status", description = "评论状态", example = "1", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer status;

    /**
    * 用户id
    */
    @NotNull(message = "[用户id]不能为空")
    @Schema(name = "userId", description = "用户id", example = "456", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer userId;

    /**
    * 用户名
    */
    @NotBlank(message = "[用户名]不能为空")
    @Size(max = 15, message = "编码长度不能超过15")
    @Schema(name = "username", description = "用户名", example = "user123", type = "string", maxLength = 15, requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 15, message = "编码长度不能超过15")
    private String username;

    /**
    * 楼层
    */
    @NotNull(message = "[楼层]不能为空")
    @Schema(name = "floor", description = "楼层", example = "1", type = "object", requiredMode = Schema.RequiredMode.REQUIRED)
    private Object floor;

    /**
    * 评论内容
    */
    @NotBlank(message = "[评论内容]不能为空")
    @Schema(name = "content", description = "评论内容", example = "这是一条评论", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
    private String content;

    /**
    * 逻辑删除。1为已删除
    */
    @NotNull(message = "[逻辑删除。1为已删除]不能为空")
    @Schema(name = "isDelete", description = "逻辑删除。1为已删除", example = "0", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer isDelete;

    /**
    * 记录创建时间
    */
    @NotNull(message = "[记录创建时间]不能为空")
    @Schema(name = "createTime", description = "记录创建时间", example = "2023-10-01T12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    /**
    * 创建人id
    */
    @NotNull(message = "[创建人id]不能为空")
    @Schema(name = "createId", description = "创建人id", example = "789", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer createId;

    /**
    * 最后修改时间
    */
    @NotNull(message = "[最后修改时间]不能为空")
    @Schema(name = "updateTime", description = "最后修改时间", example = "2023-10-01T12:00:00", type = "string", format = "date-time", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime updateTime;

    /**
    * 最后修改人id
    */
    @NotNull(message = "[最后修改人id]不能为空")
    @Schema(name = "updateId", description = "最后修改人id", example = "101112", type = "integer", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer updateId;

}
